<!DOCTYPE html>
{% load i18n %}
{% load static %}
<html>
<head>
    {% block meta %}
    {% endblock meta %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=1040">
    {#    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>#}
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" crossorigin="anonymous">

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" crossorigin="anonymous"></script>

    <link href="https://fonts.googleapis.com/css?family=Exo+2" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

    <script src="{% static 'main/script/bazo.js' %}"></script>
    {#<link href="{% static 'main/style/bazo.css' %}" rel="stylesheet">#}
    <link href="{% static 'komunumoj/style/komunumo.css' %}" rel="stylesheet">
    <link href="{% static 'uzantoj/style/uzantoj.css' %}" rel="stylesheet">

    {% block css_js %}
    {% endblock css_js %}

    <title>{% block title %}{% endblock title %} — {% trans 'Teknokomo' %}</title>
</head>
<body>
<header>
    <nav class="navbar navbar-dark navbar-expand-lg bg-dark sticky-top justify-content-between">
        <div class="container">
            <a class="navbar-brand" href="/">
                <img src="{% static 'main/images/logo.png' %}" alt="{% trans 'Teknokomo' %}">
            </a>
            {% if user.is_authenticated %}
                <form action="{% url 'search' %}" class="form-inline" method="get">
                    {{ search_form.search_field }}
                    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Поиск</button>
                </form>
            {% endif %}
            <div>
                <ul class="navbar-nav">
                    <li class="nav-item active">
                        <a class="nav-link" href="#">Поехали<span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Знания</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Энциклопедия</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Мессенджер</a>
                    </li>
                    {% if user.is_authenticated %}
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span>{{ a_uzanto.unua_nomo__enhavo }}</span>
                                <div>
                                    {% if a_uzanto.fotoj_fotojuzantojavataro_posedanto__bildo_min %}
                                        <img src="{% get_media_prefix %}{{ a_uzanto.fotoj_fotojuzantojavataro_posedanto__bildo_min }}">
                                    {% else %}
                                        {% if user.sekso == 'vira' or user.sekso is None %}
                                            <img src="{% static 'main/images/vira-avataro-min.png' %}">
                                        {% elif user.sekso == 'virina' %}
                                            <img src="{% static 'main/images/virina-avataro-min.png' %}">
                                        {% endif %}
                                    {% endif %}
                                </div>
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                                <a class="dropdown-item" href="{{ user.get_absolute_url }}">{% trans 'Mia planedo' %}</a>
                                <div class="dropdown-divider"></div>
                                {% if a_uzanto.is_admin %}
                                    <a class="dropdown-item disabled" href="#">{% trans 'Sciigoj' %}</a>
                                {% else %}
                                    <a class="dropdown-item disabled" href="#">{% trans 'Sciigoj' %}</a>
                                {% endif %}
                                <a class="dropdown-item" href="{% url "uzantoj:uzantoj_agordoj" user.id %}">{% trans 'Agordoj' %}</a>
                                <a class="dropdown-item" href="/p5/">{% trans 'Helpo' %}</a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="{% url 'registrado:elsaluti' %}">{% trans 'Elsaluti' %}</a>
                            </div>
                        </li>
                    {% else %}
                        <div>
                            <span>{% trans 'Ensaluti' %}</span>
                            <div>
                                <img src="{% static 'main/images/login-avatar.png' %}">
                            </div>
                        </div>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>
</header>
<main>
    {% block main %}
        <div class="container">
            <div class="row">
                {% if user.is_authenticated %}
                    <aside>
                        <div class="col-3">
                            <ul class="nav flex-column">
                                <li class="nav-item">
                                    <a class="nav-link active" href="/idu{{ user.id }}">{% trans 'Mia planedo' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/novayoj">{% trans 'Novaĵoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/kmr">{% trans 'Gekamaradoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/socio">{% trans 'Komunumoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link disabled" href="/lab{{ user.id }}">{% trans 'Laboro' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/sano{{ user.id }}">{% trans 'Sano' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/tenu{{ user.id }}">{% trans 'Tenejo' %}</a>
                                </li>
                            </ul>
                            <ul class="nav flex-column">
                                <li class="nav-item">
                                    <a class="nav-link disabled" href="#">{% trans 'Dekretumoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="/premioj">{% trans 'Premioj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link disabled" href="#">{% trans 'Dokumentoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link disabled" href="#">{% trans 'Legosignoj' %}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link disabled" href="#">{% trans 'Ludoj' %}</a>
                                </li>
                            </ul>
                        </div>
                    </aside>
                {% else %}
                    <div class="open-menu">
                        <form method="POST" action="{% url 'registrado:ensaluti' %}">
                            {% csrf_token %}
                            {{ registrado_formo.as_p }}
                            <button class="submit" id="registrado_selection_submit" style="width: 100%;">{% trans 'Ensaluti' %}</button>
                            <a href="{% url 'registrado:restarigo' %}">{% trans 'Renovigi aliron' %}</a> | <a href="{% url 'registrado:registrado' %}">{% trans 'Registrado' %}</a>
                        </form>
                    </div>
                    <div class="left-side">
                        <aside class="g_grid__sidebar" data-role="desktop_menu">
                            <div class="menu-1-container">
                                <ul id="menu-1" class="menu">
                                    <li id="home" class="menu-item home"><a href="/p5/">{% trans 'Informo' %}</a></li>
                                </ul>
                            </div>
                        </aside>
                    </div>
                {% endif %}
                <div class="col-9">
                    {% block main_side %}
                    {% endblock main_side %}
                </div>
            </div>
        </div>
    {% endblock main %}
</main>
<div style="display: none">
    {% block hidden_blocks %}
    {% endblock %}
</div>
</body>
</html>